home *** CD-ROM | disk | FTP | other *** search
- Path: rcp6.elan.af.mil!rscernix!danpop
- From: danpop@mail.cern.ch (Dan Pop)
- Newsgroups: comp.lang.c
- Subject: Re: Why is C faster than FORTRAN?
- Date: 4 Apr 96 20:34:52 GMT
- Organization: CERN European Lab for Particle Physics
- Message-ID: <danpop.828650092@rscernix>
- References: <1996Mar20.132506.91237@ucl.ac.uk> <4jpabs$4pv@opal.southwind.net>
- NNTP-Posting-Host: ues5.cern.ch
- X-Newsreader: NN version 6.5.0 #7 (NOV)
-
- In <4jpabs$4pv@opal.southwind.net> uar@southwind.net (richard mross) writes:
-
-
- >>|>My question is: what is the reason that C is so much quicker? Is C normally
- >>|>faster than FORTRAN?
- >
- > write a program in both languages and set the compilers on both to
- >output assembly code. compare the output to see what one compiler is
- >doing compared to the other
-
- Once upon a time this approach used to work. For a modern processor,
- be it Pentium (Pro) or any RISC flavour, only a wizard could tell which
- assembly code sequence is faster simply by looking at the code. The rest
- of us mere mortals are condemned to benchmarking the compiler output in
- order to decide which is more efficient.
-
- If a significant amount of time is spent in library functions/procedures,
- looking at the assembly code is useless for _any_ processor.
-
- Dan
- --
- Dan Pop
- CERN, CN Division
- Email: danpop@mail.cern.ch
- Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
-